<?php
/**
 * Created by PhpStorm.
 * User: chenzhenlin
 * Date: 2019/3/28
 * Time: 10:47 PM
 */

namespace app\api\validate;


use think\Validate;

class AdminValidate extends Validate
{
    protected $rule = [
        'id'=>'number',
        'admin_name'=>'',
        'admin_password'=>'',
        'admin_mobile'=>'',
        'admin_avatar'=>'',
        'is_super'=>'number',
        'create_time'=>'dateFormat:y-m-d',
        'update_time'=>'dateFormat:y-m-d',
    ];

    protected $message = [
    ];

    public function __construct(array $rules = [], array $message = [], array $field = [])
    {
        parent::__construct($rules, $message, $field);
    }

    public function checkLogin(){
        $this->rule['admin_name'] = 'require';
        $this->rule['admin_password'] = 'require';
    }
    public function checkAdd(){
        $this->rule['admin_name'] = 'require';
        $this->rule['admin_password'] = 'require';
    }


}